home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Top 200 Programs
/
Top 200 Programs.iso
/
Bob8
/
THOMPSON
/
LIBERTY
/
PRODUCT
/
LB14W.EXE
/
BUTTONS1.BAS
< prev
next >
Wrap
BASIC Source File
|
1994-04-23
|
2KB
|
87 lines
' This is a turtle graphics demo for LB V1.0
nomainwin ' open no main window
size$ = "100"
size = val(size$)
color$ = "black"
button #1, Triangle, [triangle], LR, 104, -12
button #1, Square, [square], LR, 38, -12
button #1, Size, [size], LR, -12, -12
button #1, Red, [colorRed], UL, 5, 5
button #1, Blue, [colorBlue], UL, 46, 5
button #1, Green, [colorGreen], UL, 95, 5
menu #1, &Colors, &red, [colorRed], &blue, [colorBlue], &green, [colorGreen]
menu #1, &Graph, &square, [square], &triangle, [triangle], &size, [size], |, &quit, [quit]
open "This is a turtle graphics window!" for graphics_nsb as #1
print #1, "trapclose [quit]"
[loop] ' stop and wait for buttons to be pressed
input a$
goto [loop]
[triangle]
print #1, "color "; color$
print #1, "cls ; home ; down ; north"
for x = 1 to size
print #1, "turn 122 ; go "; str$(x*2)
next x
print #1, "flush"
goto [loop]
[square]
print #1, "color "; color$
print #1, "cls ; home ; down ; north"
for x = 1 to size
print #1, "turn 88 ; go "; str$(x*2)
next x
print #1, "flush"
goto [loop]
[colorRed]
color$ = "red"
goto [loop]
[colorBlue]
color$ = "blue"
goto [loop]
[colorGreen]
color$ = "green"
goto [loop]
[size]
prompt "What size figure?"; size$
size = val(size$)
if size > 0 then [loop]
beep
notice "Size must be > 0"
goto [size]
[quit]
confirm "Do you want to quit Buttons?"; quit$
if quit$ = "no" then [loop]
close #1
end